﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script type="text/javascript" src="../Scripts/jquery.js"></script>
<script type="text/javascript" src="../Scripts/Verify.js"></script>
<link href="../Styles/Public.css" rel="stylesheet" type="text/css" />
</head>
<body>
<h1> 分组验证</h1>
<h2> 概述</h2>
<div class="desc">
  <p> 在同一个表单中，经常会出现多种组合验证，例如A按钮验证一部分控件，B按钮又验证另一部分控件，或相互交叉验证。</p>
  <p> 如下，按钮与录入控件的group的值一致，当点击按钮时，即实现验证。 </p>
  <p> &lt;input type=&quot;text&quot; datatype=&quot;email&quot; nullable=&quot;false&quot; <strong>group=&quot;a&quot;</strong>/&gt;</p>
  <p> &lt;input type=&quot;submit&quot; name=&quot;button&quot; class=&quot;button&quot;
value=&quot;验证表单&quot; verify=&quot;true&quot;<strong> group=&quot;a&quot;</strong> /&gt;</p>
</div>
<h2> 示例</h2>
<h3> 1、简单分组验证</h3>
<div class="desc">
  <fieldset>

<pre>&lt;form onsubmit=&quot;alert('验证成功');return false;&quot; place=&quot;right&quot;&gt;<br /> &lt;p&gt;账号：<br />&lt;input name=&quot;&quot; type=&quot;text&quot; nullable=&quot;false&quot; datatype=&quot;user&quot; <strong>group=&quot;a&quot;</strong>/&gt;（a组）<br />&lt;/p&gt;<br />&lt;p&gt;姓名：<br />&lt;input name=&quot;&quot; type=&quot;text&quot; size=&quot;6&quot; datatype=&quot;chinese&quot; 
lenlimit=&quot;2-4&quot; <strong>group=&quot;b&quot;</strong> alt=&quot;限2至4个中文字/符&quot;&gt;&lt;span&gt;（b组）&lt;/span&gt;<br />&lt;/p&gt;<br />&lt;p&gt;年龄：<br />&lt;input type=&quot;text&quot; size=&quot;4&quot; datatype=&quot;uint&quot; nullable=&quot;false&quot; 
 place=&quot;right&quot; <strong>group=&quot;a&quot;</strong>/&gt;（a组）<br />&lt;/p&gt;<br />&lt;p&gt;电话：<br />&lt;input type=&quot;text&quot; datatype=&quot;mobile|tel&quot; alt=&quot;请输入正确的电话号/码&quot; <strong>group=&quot;b&quot;</strong>&gt;（b组）<br />&lt;/p&gt;<br />&lt;p&gt;邮箱：<br />&lt;input type=&quot;text&quot; datatype=&quot;email&quot; nullable=&quot;false&quot; /&gt;(没有组)<br />&lt;/p&gt;<br />  &lt;p&gt;<br />&lt;input type=&quot;submit&quot; name=&quot;button&quot; class=&quot;button&quot; value=&quot;验证A组&quot; verify=&quot;true&quot; <strong>group=&quot;a&quot;</strong>/&gt;<br />&lt;input type=&quot;submit&quot; name=&quot;button&quot; class=&quot;button&quot; value=&quot;验证B组&quot; verify=&quot;true&quot; <strong>group=&quot;b&quot;</strong>/&gt;<br />&lt;input type=&quot;submit&quot; name=&quot;button&quot; class=&quot;button&quot; value=&quot;验证没有组的&quot; verify=&quot;true&quot;/&gt;<br />  &lt;/p&gt;<br />&lt;/form&gt;</pre>
<form onsubmit="alert('验证成功');return false;" place="right">
 <p>
账号：
<input name="" type="text" nullable="false" datatype="user" group="a"/>（a组）
</p>
<p>
姓名：
<input name="" type="text" size="6" datatype="chinese" lenlimit="2-4" group="b" alt="限2至4个中文字/符"><span>（b组）</span>
</p>
<p>
年龄：
<input type="text" size="4" datatype="uint" nullable="false" place="right" group="a"/>（a组）
</p>
<p>
电话：
<input type="text" datatype="mobile|tel" alt="请输入正确的电话号/码" group="b">（b组）
</p>
<p>
邮箱：
<input type="text" datatype="email" nullable="false" />(没有组)
</p>
  <p>
<input type="submit" name="button" class="button" value="验证A组" verify="true" group="a"/>
<input type="submit" name="button" class="button" value="验证B组" verify="true" group="b"/>
<input type="submit" name="button" class="button" value="验证没有组的" verify="true"/>
<input type="submit" name="button" class="button" value="验证所有" verify="true" group="all"/>
  </p>
</form>
  </fieldset>
  
</div>
<h3> 2、交叉组验证</h3>
<div class="desc">
  <fieldset>

<pre>&lt;form onsubmit=&quot;alert('验证成功');return false;&quot; place=&quot;right&quot;&gt;<br />  &lt;p&gt; 账号：<br />&lt;input name=&quot;&quot; type=&quot;text&quot; nullable=&quot;false&quot; datatype=&quot;user&quot; <strong>group=&quot;a&quot;</strong>/&gt;（a组）<br /> &lt;/p&gt;<br />&lt;p&gt;姓名：<br />&lt;input name=&quot;&quot; type=&quot;text&quot; size=&quot;6&quot; nullable=&quot;false&quot; <strong>group=&quot;b&quot;</strong>&gt;&lt;span&gt;（b组）&lt;/span&gt;<br />&lt;/p&gt;<br />&lt;p&gt;年龄：<br />&lt;input type=&quot;text&quot; size=&quot;4&quot; datatype=&quot;uint&quot; nullable=&quot;false&quot; place=&quot;right&quot; <strong>group=&quot;c&quot;</strong>/&gt;（c组）<br />&lt;/p&gt;<br />&lt;p&gt;电话：<br />&lt;input type=&quot;text&quot; datatype=&quot;mobile|tel&quot; nullable=&quot;false&quot;  <strong>group=&quot;a|c&quot;</strong>&gt;（同时属于a组和c组）<br />&lt;/p&gt;<br />&lt;p&gt;<br />邮箱：&lt;input type=&quot;text&quot; datatype=&quot;email&quot; nullable=&quot;false&quot; <strong>group=&quot;b|c&quot;</strong> /&gt;(同时属于b组和c组)<br />&lt;/p&gt;<br />&lt;p&gt; 网址：<br />&lt;input name=&quot;&quot; type=&quot;text&quot; begin=&quot;http://|https://&quot; 
nullable=&quot;false&quot; <strong>group=&quot;a|b&quot;</strong> /&gt;（同时属于a组和b组）<br />  &lt;/p&gt;<br />  &lt;p&gt;<br />&lt;input type=&quot;submit&quot; name=&quot;button&quot; class=&quot;button&quot; value=&quot;验证A组&quot; verify=&quot;true&quot; <strong>group=&quot;a&quot;</strong>/&gt;<br />&lt;input type=&quot;submit&quot; name=&quot;button&quot; class=&quot;button&quot; value=&quot;验证B组&quot; verify=&quot;true&quot; <strong>group=&quot;b&quot;</strong>/&gt;<br />&lt;input type=&quot;submit&quot; name=&quot;button&quot; class=&quot;button&quot; value=&quot;验证C组&quot; verify=&quot;true&quot; <strong>group=&quot;c&quot;</strong>/&gt;<br />&lt;/p&gt;<br />  &lt;p&gt;<br />&lt;input type=&quot;submit&quot; name=&quot;button&quot; class=&quot;button&quot; value=&quot;验证A组和B组&quot; verify=&quot;true&quot; <strong>group=&quot;a|b&quot;</strong>/&gt;<br />&lt;input type=&quot;submit&quot; name=&quot;button&quot; class=&quot;button&quot; value=&quot;验证B组和C组&quot; verify=&quot;true&quot; <strong>group=&quot;b|c&quot;</strong>/&gt;<br />&lt;input type=&quot;submit&quot; name=&quot;button&quot; class=&quot;button&quot; value=&quot;验证A组和C组&quot; verify=&quot;true&quot; <strong>group=&quot;a|c&quot;</strong>/&gt;<br />  &lt;/p&gt;   <br /> &lt;/form&gt;</pre>
<form onsubmit="alert('验证成功');return false;" place="right">
 <p>
账号：
<input name="" type="text" nullable="false" datatype="user" group="a"/>（a组）
</p>
<p>
姓名：
<input name="" type="text" size="6" nullable="false" group="b"><span>（b组）</span>
</p>
<p>
年龄：
<input type="text" size="4" datatype="uint" nullable="false" place="right" group="c"/>（c组）
</p>
<p>
电话：
<input type="text" datatype="mobile|tel" nullable="false"  group="a|c">（同时属于a组和c组）
</p>
<p>
邮箱：
<input type="text" datatype="email" nullable="false" group="b|c" />(同时属于b组和c组)
</p>
<p> 网址：
<input name="" type="text" begin="http://|https://" nullable="false" group="a|b" />（同时属于a组和b组）
  </p>
  <p>
<input type="submit" name="button" class="button" value="验证A组" verify="true" group="a"/>
<input type="submit" name="button" class="button" value="验证B组" verify="true" group="b"/>
<input type="submit" name="button" class="button" value="验证C组" verify="true" group="c"/>
</p>
  <p>
<input type="submit" name="button" class="button" value="验证A组和B组" verify="true" group="a|b"/>
<input type="submit" name="button" class="button" value="验证B组和C组" verify="true" group="b|c"/>
<input type="submit" name="button" class="button" value="验证A组和C组" verify="true" group="a|c"/>
  </p>
</form>
  </fieldset>
  
</div>
</body>
</html>
